package moc.zard.xg.result;


import lombok.*;
import lombok.experimental.Accessors;
import moc.zard.xg.mocEnum.status;

import java.io.Serializable;
import java.util.List;


@Data
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode
@ToString
public class Result implements Serializable {
    public Integer code;
    public String msg;
    public List<Object> data;

    public static Result setOK() {
        return new Result().setMsg(status.STATUS_OK.getMsg())
                .setCode(status.STATUS_OK.getCode());
    }

    public static Result setSorry() {
        return new Result().setMsg(status.STATUS_ERROR.getMsg())
                .setCode(status.STATUS_ERROR.getCode());
    }
}
